#ifndef __PREFS_EEPROM_H__
#define __PREFS_EEPROM_H__

#include <stdbool.h>
#include <stdint.h>
#include "prefs_stm32_config.h"

#ifdef __cplusplus
extern "C"
{
#endif

    typedef struct
    {
        uint8_t *pData;
        uint32_t Size;
        uint32_t PageSectorSize;
        uint32_t Address;
        uint8_t PageSectorNumber;
#if (defined FLASH_BANK_1) || (defined FLASH_BANK_2)
        uint8_t BankNumber;
#endif

    } EE_HandleTypeDef;

    bool prefs_ee_init(void *pData, uint32_t Size);
    uint32_t prefs_ee_capacity(void);
    bool prefs_ee_format(void);
    void prefs_ee_read(void);
    bool prefs_ee_write(void);

#ifdef __cplusplus
}
#endif
#endif // __PREFS_EEPROM_H__
